//
//  ALTableViewCell.m
//  ios-loan-assistant
//
//  Created by hcs on 2018/6/29.
//  Copyright © 2018年 guoqingping. All rights reserved.
//

#import "ALTableViewCell.h"
#import "ALUILabel.h"
#import "Masonry.h"
#import "ALUtilsMacro.h"

@interface ALTableViewCell()
@property (nonatomic, strong) ALUILabel *line;
@end

@implementation ALTableViewCell

- (void)updateConstraints{
    
    [super updateConstraints];
    
    [self.line mas_updateConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView.mas_bottom);
        make.left.equalTo(self.contentView.mas_left);
        make.size.mas_equalTo(CGSizeMake(AL_ScreenWidth, .5f));
    }];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.isShowLine=NO; //默认是不显示
        [self.contentView addSubview:self.line];
        [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.contentView.mas_bottom);
            make.left.equalTo(self.contentView.mas_left);
            make.size.mas_equalTo(CGSizeMake(AL_ScreenWidth, .5f));
        }];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


#pragma mark - get set
-(ALUILabel *)line{
    if (!_line) {
        _line=[[ALUILabel alloc] initLine];
    }
    return _line;
}
-(void)setIsShowLine:(BOOL)isShowLine{
    _isShowLine=isShowLine;
    [self.line setHidden:!_isShowLine];
}
@end
